package run.demo;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.support.GenericApplicationContext;
import utils.Utils;

@org.springframework.boot.test.context.SpringBootTest(classes = SpringBootTestForResourceCheck.Dummy.class,
        webEnvironment = SpringBootTest.WebEnvironment.NONE)
public class SpringBootTestForResourceCheck {
    @Autowired
    GenericApplicationContext context;

    @Import(value = {com.SpringApplication.class,SpringBootTestForResourceCheck.class})
    @Configuration
    public class Dummy{
    }

    Object lock = new Object();

    @Test
    public void verify() throws InterruptedException {

        Utils.print(context);
        synchronized (lock){
            lock.wait();
        }

    }

}
